//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using CommunityServer.Components;
using CommunityServer.Controls;
using CommunityServer.Files.Components;

namespace CommunityServer.Files.Controls
{
	/// <summary>
	/// Summary description for TagBrowser.
	/// </summary>
	public class TagBrowser : FileGalleryTemplatedWebControl
	{
		protected CSContext csContext = CSContext.Current;
		private IText Title;

		protected override void AttachChildControls()
		{
			Title = FindText( "Title" );
		}


		protected override void OnLoad(EventArgs e) 
		{
			base.OnLoad (e);

			this.DataBind();
		}

		public override void DataBind()
		{
			base.DataBind();

			Folder folder = Folders.GetFolder(csContext.ApplicationKey);

			if (Title != null)
				Title.Text = string.Format(FileGalleryResourceManager.GetString("Files_TagBrowser_Title"), folder.Name);

			UsersOnline.SetLocation(string.Format(FileGalleryResourceManager.GetString("Files_TagBrowser_Title"), folder.Name));
		}
	}
}
